<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
$lang = $_SESSION['lang'];
if (empty($lang) || $lang == "EN") {
	include "../value/value_en.php";
} else if($lang == "VN") {
	include "../value/value_vn.php";
}
else {
	include "../value/value_kr.php";
}
include '../operations/connection.php';	
$idassets=$_REQUEST['idassets'];
$idtype=$_REQUEST['idtype'];
if ($idassets!=0){
	$borrow_assets=mysql_query("SELECT b.*,e.FullName,a.`name` FROM borrow_assets b LEFT JOIN employee e ON b.idemployee=e.IDEmployee, assets a WHERE b.count!=0 AND b.id_assets=a.id AND a.id='".$idassets."';");
}else if ($idtype!=0){
	$borrow_assets=mysql_query("SELECT b.*,e.FullName,a.`name` FROM borrow_assets b LEFT JOIN employee e ON b.idemployee=e.IDEmployee, assets a WHERE b.count!=0 AND b.id_assets=a.id AND a.type='".$idtype."';");
}else
	$borrow_assets=mysql_query("SELECT b.*,e.FullName,a.`name` FROM borrow_assets b LEFT JOIN employee e ON b.idemployee=e.IDEmployee, assets a WHERE b.count!=0 AND b.id_assets=a.id;");
$notBorrow=array();
while ($r = mysql_fetch_array($borrow_assets)){
		$notBorrow[]=array($r['id'],$r['id_assets'],$r['count'],$r['total'],$r['FullName'],$r['datetime'],$r['note'],$r['name']);
}



?>
<table cellpadding="0" cellspacing="1" border="0" class="ftable1" style="padding-left: 10px">
				            <tr>
				            	<th style="width: 30px"><?=$l_no?></th>
				            	<th style="width: 30px">
				            	<!--  <button type="submit" name="Delete" style="border: 0; background: transparent">
								    <img src="images/del.png"  />
								</button>-->
								</th>
				                <th style="width: 200px"><?php echo $l_nameassets;?></th>
				                <th style="width: 80px"><?php echo $l_countassets2;?></th>
				                <th style="width: 80px"><?php echo $l_totalassets2;?></th>
				                <th style="width: 200px"><?php echo $l_employee;?></th>
				                <th style="width: 200px"><?php echo $l_time;?></th>
				                <th style="width: 200px"><?php echo $l_note;?></th>
				                
				            </tr>
				            <?php 
				            $i=0;
				            foreach ($notBorrow as $value => $giatri)
						    {
						    
				            	?>
				            <tr
				           		 <?php 
				            		if ($giatri[2]==$giatri[3]) 
				            			echo "style='background: rgb(139, 172, 241);'";
				            		else if ($giatri[2]<$giatri[3])
				            			echo "style='background: rgb(161, 191, 252);'";
				            	?>
				            >
				            	<td><?=$i+1?></td>
				            	<td><input type="checkbox" name="checknot" id="<?php echo 'checknot'.$i?>" onclick="checkonlynot(this.id,document.frmChecknot.checknot);"  value="<?=$giatri[0]?>"></td>
				                <td><?php echo $giatri[7];?></td>
				                <td><?php echo $giatri[2];?></td>
				                <td><?php echo $giatri[3];?></td>
				                <td><?php echo $giatri[4];?></td>
				                <td><?php echo $giatri[5];?></td>
				                <td><?php echo $giatri[6];?></td>
				            </tr>
				            <?php 
				            $i++; 
							}
							if($i==0){
				            ?>
				            	 <tr><td colspan="8" style="height:30px;text-align:left;padding-left:20px;"><?php echo $l_list_emplty;?></td></tr>
				            	 <?php }?>
			   </table>
			   <br>
			   <div id="frmnotCheck" style="display: none">
			   <input type="hidden" value="1" name="idnotCheck" id="idnotCheck">
			   <table style=" padding-left:10px;">

							<tr >
								<td  class="tdfirst" style="width: 180px"><?php echo $l_nameassets;?></td>
								<td>
									<input type="text" name="namenotCheck" id="namenotCheck"  class="in_testfield" style="width:200px;float:left;height:24px;" disabled="disabled" />
								</td>
								<td ></td>
								<td></td>
							</tr >		
							<tr >
								<td  class="tdfirst" style="width: 180px"><?php echo $l_employee;?></td>
								<td>
									<input type="text" name="employeenotCheck" id="employeenotCheck"  class="in_testfield" style="width:200px;float:left;height:24px;" disabled="disabled" />
								</td>
								<td ></td>
								<td></td>
							</tr >	
							<tr >
								<td  class="tdfirst" style="width: 180px"><?php echo $l_time;?></td>
								<td>
									<input type="text" name="datetimenotCheck" id="datetimenotCheck"  class="in_testfield" style="width:200px;float:left;height:24px;" disabled="disabled" />
								</td>
								<td ></td>
								<td></td>
							</tr >		
							<tr >
								<td  class="tdfirst" style="width: 180px"><?php echo $l_countassets2.'/'.$l_totalassets2;?></td>
								<td>
									<select name="countnotCheck" id="countnotCheck" style="height: 24px">
										<option value="1">1</option>
									</select>/
									<select name="totalnotCheck" id="totalnotCheck" style="height: 24px" disabled="disabled">		
										<option value="4" selected="selected">4</option>
									</select>
								</td>
								<td></td>
								<td></td>
							</tr>
							<!--  <tr >
								<td  class="tdfirst" style="width: 180px"><?=$l_employee?></td>
								<td style="width: 180px">
									<?php echo $bien?>
								</td>
								<td></td>
								<td></td>
							</tr >-->
							<tr >
								<td  class="tdfirst" style="height:24px;"><?=$l_note?></td>
								<td><input type="text" name="notenotCheck" id="notenotCheck"  class="in_testfield" style="width:365px;float:left;height:24px;" /></td>
								<td><input style="margin:12px 5px 0 0; font-size: 12px;" type="button" value="<?=$l_xacnhan?>" name="xacnhanis"   class="btn_choose"  /></td>
								<td></td>
							</tr>
							
				</table>
				</div>
<?php mysql_close($connection);?>									